package jjn.round1;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Jiang Jining
 * @since 2022-11-22 23:36
 */
public class LeetCode448_FindAllDisappearedNumbersInAnArray {
    public List<Integer> findDisappearedNumbers(int[] nums) {
        List<Integer> result = new ArrayList<>();
        boolean[] array = new boolean[nums.length + 1];
        for (int num : nums) {
            array[num] = true;
        }
        for (int i = 1; i <= nums.length; i++) {
            if (!array[i]) {
                result.add(i);
            }
        }
        return result;
    }
}
